using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevExpress.CodeRush.StructuralParser;

namespace DX_SourceOutliner
{
    public abstract class VisibilityProcessorBase : INodeProcessor
    {
        protected ISourceTreeNode _source;
        protected NodeOptions _options;

        /// <summary>
        /// Initializes a new instance of the VisibilityProcessorBase class.
        /// </summary>
        /// <param name="options"></param>
        public VisibilityProcessorBase(NodeOptions options)
        {
            _options = options;
        }

        public TreeNode Process(TreeNode node)
        {
            _source = node.Tag as ISourceTreeNode;

            if (!CheckNodeVisibility())
                if (node.Parent != null)
                    node.Parent.Nodes.Remove(node);

            return node;
        }

        protected abstract bool CheckNodeVisibility();

    }
}
